package com.xkdx.caipiao;

import java.util.HashMap;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;

import com.xkdx.caipiao.cost.CostRechargeActivty;
import com.xkdx.caipiao.module.network.AbsModule;
import com.xkdx.caipiao.my.FlowRechargeActivity;
import com.xkdx.guangguang.ShopActivity;

/**
 * 
 * <pre>
 * 功能说明: 主界面
 * 日期:	2014年11月2日
 * 开发者:	杨建波
 * 
 * 历史记录
 *    修改内容：
 *    修改人员：
 *    修改日期： 2014年11月2日
 * </pre>
 */
public class UpdateHomeActivity extends ThreadActivity implements
		OnClickListener {
	private RelativeLayout goToWifi, goToCaiPiao, goToPhone,goToShop;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_home_update_caipiao);
		initView();
		viewSetListener();
	}

	/**
	 * 组件初始化
	 */
	private void initView() {
		goToWifi = (RelativeLayout) findViewById(R.id.go_to_wifi);
		goToCaiPiao = (RelativeLayout) findViewById(R.id.go_to_caipiao);
		goToPhone = (RelativeLayout) findViewById(R.id.go_to_phone);
		goToShop = (RelativeLayout) findViewById(R.id.go_to_shop);
	}

	/**
	 * 组件设置监听
	 */
	private void viewSetListener() {
		goToWifi.setOnClickListener(this);
		goToCaiPiao.setOnClickListener(this);
		goToPhone.setOnClickListener(this);
		goToShop.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.go_to_wifi:
			startIntent(FlowRechargeActivity.class);
			break;
		case R.id.go_to_caipiao:
			startIntent(MainTabActivity.class);
			break;
		case R.id.go_to_phone:
			startIntent(CostRechargeActivty.class);
			break;
		case R.id.go_to_shop:
			startIntent(ShopActivity.class);
			break;

		default:
			break;
		}
	}

	private void startIntent(Class a) {
		Intent inten = new Intent(UpdateHomeActivity.this, a);
		startActivity(inten);
	}

	@Override
	public void showOnPost(HashMap<String, AbsModule> result) {
	}

	@Override
	public void startThread() {
	}

	@Override
	public void onBackClick(View view) {
	}

}
